Repository navigation
Conversation
AddNewItemYamlTest failed with an NPE at line 57 when it was the first test of a JVM with empty IDE caches, as on CI: the task config was missing. createConfigFiles schedules the writes with invokeLater, and UIUtil.dispatchAllInvocationEvents didn't run them there, even when called for 5 seconds; they ran only after the test. PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue releases the write-intent lock while it dispatches and waits for an invokeLater scheduled after them, so the configs are written before it returns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AddNewItemYamlTest > test new task file addedfails withNullPointerException at AddNewItemYamlTest.kt:57when it's the first test of a JVM with empty IDE caches. That is what CI has: it failed "Check the plugin for 261" on #68, whose changes don't touch YAML.Cause
createConfigFilescallsYamlFormatSynchronizer.saveAll, which writes every config insideproject.invokeLater, and then relies onUIUtil.dispatchAllInvocationEvents()to run them. In the first test on a cold start, that call doesn't run them. Calling it in a loop for 5 seconds didn't help either: the runnables ran only after the test body, so the task config was missing at line 57.PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()does run them. It releases the write-intent lock while it dispatches, and returns only after aninvokeLaterscheduled after them has run.Fix
createConfigFilesusesPlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue(). All its callers run on the EDT outside a write action, which that method requires.Testing
Locally on 263, with the test sandbox's
system-testdirectory removed before each run:AddNewItemYamlTestalone and 1 of the YAML test subset. The same subset passed with warm caches.AddNewItemYamlTestalone passed 2 of 2 cold runs.:intellij-plugin:testwith the fix, on a cold sandbox: 765 tests, no failures. This ran on the [ALT-11077] Support every Hyperskill step type and Next navigation between topics #68 branch, which has the sameYamlTestUtils.ktasmain; this branch itself is checked only by CI.